package com.seadragon.apps.doctorcard.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.vividsolutions.jts.geom.Point;

@Entity
@Table(name = "chat")
public class Chat implements Serializable {
	private static final long serialVersionUID = 7665031480453220371L;
	
	public Chat(){}
	
	public Chat(long id){
		this.id = id;
	}
	
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;
	
	@Column(name="CHAT_NAME")
	private String chatName;

	@Column(name="UUID")
	private String uuid;
	
	@Column(name="CAPACITY")
	private int capacity;

	@Column(name = "LOCATION")
    @Type(type = "org.hibernate.spatial.GeometryType")
    private Point location;

	@JsonSerialize(using = DateSerializer.class)
	@Column(name="DATE_CREATED")
	private Date dateCreated;
	
	@JsonSerialize(using = DateSerializer.class)
	@Column(name="DATE_UPDATED")
	private Date dateUpdated;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getChatName() {
		return chatName;
	}

	public void setChatName(String chatName) {
		this.chatName = chatName;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public Point getLocation() {
		return location;
	}

	public void setLocation(Point location) {
		this.location = location;
	}

	public Date getDateUpdated() {
		return dateUpdated;
	}

	public void setDateUpdated(Date dateUpdated) {
		this.dateUpdated = dateUpdated;
	}

}
